function creatStore(data) {
  var state = data || {};
  var list = [];
  return {
    getState: function (prop) {
      return state[prop];
    },
    dispatch: function (key) {
      state[key.type] = key.value;
      list.forEach(item => {
        item();
      });
    },
    subsribe: function (func) {
      list.push(func);
    },
  };
}
